cmake_minimum_required(VERSION 3.10)
project(gtest_test)

enable_testing()
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0")
include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0/googletest/include")

set(GTEST_LIB gtest gtest_main)

add_executable(sample1_unittest sample1_unittest.cc sample1.cc)
target_link_libraries(sample1_unittest gtest gtest_main)
add_test(NAME sample1_unittest COMMAND sample1_unittest)

add_executable(gtest_sample gtest_sample.cpp)
target_link_libraries(gtest_sample gtest gtest_main)
add_test(NAME gtest_sample COMMAND gtest_sample)